using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;


namespace Blople.GameComponents
{
    public class ScoreField : Microsoft.Xna.Framework.DrawableGameComponent
    {
        protected SpriteFont scoreFont;

        protected int score;

        public ScoreField(Game game, SpriteFont scoreFont) : base(game)
        {
            this.scoreFont = scoreFont;
            score = 0;
        }

        public override void Initialize()
        {
            base.Initialize();
        }

        public override void Update(GameTime gameTime)
        {
            base.Update(gameTime);
        }

        public override void Draw(GameTime gameTime)
        {
            SpriteBatch sBatch = (SpriteBatch)Game.Services.GetService(typeof(SpriteBatch));
            sBatch.DrawString(scoreFont, "Score: " + score, new Vector2(127, 702), Color.Black);
            sBatch.DrawString(scoreFont, "Score: " + score, new Vector2(125, 700), new Color(118, 58, 0));
            base.Draw(gameTime);
        }

        public void IncreaseScore(int score) 
        {
            this.score += score;
        }

        public void DecreaseScore(int score)
        {
            this.score -= score;
        }

        public int Score
        {
            get { return score; }
        }
    }
}
